import { Component, OnInit } from '@angular/core'
import 'rxjs/add/observable/from'
import { Observable } from 'rxjs/Observable'
import { heroes } from '../data-model'

@Component({
  selector: 'app-hero-list',
  templateUrl: './hero-list.component.html',
  styleUrls: [ './hero-list.component.css' ]
})
export class HeroListComponent implements OnInit {
  heroes = Observable.from(heroes)
  selectedHero

  constructor() {
  }

  ngOnInit() {
  }

  select(hero) {
    this.selectedHero = hero
  }
}
